#e
#Title[ΐu^ԕv]
#Text[]
#ScriptVersion[2]

script_enemy_main
{//Enemy01
	let count=0;
	let cx=GetCenterX();//STGV[̒SxW擾
	let cy=GetCenterY();//STGV[̒SyW擾
	let imgExRumia=GetCurrentScriptDirectory~"img\ExRumia.png";
	let imgExRumiaBack=GetCurrentScriptDirectory~"img\ExRumiaBack.png";
	LoadUserShotData(GetCurrentScriptDirectory~"shot.txt");
	@Initialize
	{
		SetScore(30000);
		SetLife(500);
		SetDamageRate(10,8);
		SetTimer(90);
	
		SetGraphicRect(1,1,64,64);
		SetInvincibility(300);
		
		LoadGraphic(imgExRumia);	
		LoadGraphic(imgExRumiaBack);

		SetMovePosition02(cx,120,60);
		Concentration01(60);
		CutIn(YOUMU,"ΐu^ԕv",0,0,0,0,0);//XyJ[h\
	}
	@MainLoop
	{
		let s=0;
		let s2=1;
		let s3=2;
		let s4=3;
		let angle=rand(0,360);
		let base =GetAngleToPlayer;
		function shot(let shotid,let shotx,let shoty)
		{
			CreateShotA(shotid,shotx,shoty,0);
			SetShotDirectionType(ABSOLUTE);
			SetShotDataA(shotid,0,2,0,0,0,0,112);
			FireShot(shotid);
		}
		if(count>=60)
		{
			if(count%4==0)
			{
				shot(s,GetClipMinX,rand(GetClipMinY,GetClipMaxY));
				CreateShotA(s2,GetClipMinX,rand(GetClipMinY,GetClipMinY+180),0);	
				SetShotDataA(s2,0,1,0,0,0,2,48);
				CreateShotA(s3,0,0,0);
				SetShotDataA(s3,0,2,80,0,0,3,78);
				CreateLaserA(s4,0,0,512,16,155,30);
				SetLaserDataA(s4,0,80,0,0,0,0);
				SetShotKillTime(s4,60);
				AddShot(rand(0,GetClipMaxX),s2,s3,0);
			if(count%24==0)
			{
				AddShot(rand(0,GetClipMaxX),s2,s4,0);
			}	
				FireShot(s2);
			}
		}
		SetCollisionA(GetX(),GetY(),24);//蔻(e)o^
		SetCollisionB(GetX(),GetY(),24);//蔻(̓)o^
		count++;
	}
	@Finalize
	{//ǂ݂񂾃t@C폜
		loop(8)
		{
			CreateItem(ITEM_SCORE,cx+rand(-100,100),rand(20,100));
		}
	}
	
	@DrawLoop
	{
		//Ex[~A`
		if(count<270){SetGraphicRect(64,64,127,127)};
		if(count>=270){SetGraphicRect(1,1,64,64);}
		SetAlpha(255);
		SetTexture(imgExRumia);
		DrawGraphic(GetX(),GetY());
	}
}